fix: resolve relative imports for optimized source files (fix #23430) - #23432
Closed
DaZuiZui wants to merge 1 commit into
Closed
fix: resolve relative imports for optimized source files (fix #23430)#23432DaZuiZui wants to merge 1 commit into
DaZuiZui wants to merge 1 commit into
Conversation
7 tasks
Contributor
|
The PR has been manually labeled as likely to be created by a bot, LLM, or agent, and will be automatically closed. This may be because the PR contains LLM-generated descriptions, does not follow the PR template, is overly verbose, or does not contain any fruitful interaction, which harms the review process. Please read our AI policy for more information. If you believe this is a mistake, please reply to this comment and we will review it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
optimizeDeps.includeto their optimized dep entry?raw, workers, and URLsCause
optimizeDeps.includealready resolved and pre-bundled the source file, but the dev optimizer resolver only checked optimized metadata for bare specifiers. Relative imports went through the normal filesystem path and continued to serve source modules, leaving the generated pre-bundle unused.Fixes #23430
Tests
pnpm --filter vite build-bundlepnpm test-serve playground/optimize-deps/__tests__/optimize-deps.spec.tspnpm test-build playground/optimize-deps/__tests__/optimize-deps.spec.tspnpm --filter vite typecheckpnpm exec eslint packages/vite/src/node/plugins/resolve.ts playground/optimize-deps/__tests__/optimize-deps.spec.ts